"use strict";
cc._RF.push(module, '1d8f6TuURlGeaoDtBh4RDQX', 'ObjectPool');
// scripts/ObjectPool.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});
var a = e("AssetsManager"),
    n = cc._decorator,
    i = n.ccclass,
    r = (n.property, function () {
  function e() {
    this.ObjectNodeArray = [], this.ObjectPollArray = [], this.ObjectNameArray = ["soldier_node", "super_soldier_node", "role_effects"];
  }

  var t;
  return t = e, e.getInstance = function () {
    return t.instance || (t.instance = new t()), t.instance;
  }, e.prototype.init = function () {
    this.ObjectPollArray = [], this.ObjectNodeArray = [];

    for (var e = 0; e < this.ObjectNameArray.length; e++) {
      var t = new cc.NodePool(),
          o = a["default"].getInstance().getFightPrefab(this.ObjectNameArray[e]);
      this.ObjectNodeArray.push(o);

      for (var n = 0; n < 6; n++) {
        var i = cc.instantiate(o);
        i.active = !1, t.put(i);
      }

      this.ObjectPollArray[e] = t;
    }
  }, e.prototype.creatPlane = function (e) {
    var t = this.ObjectPollArray[e];
    return t.size() > 0 ? t.get() : cc.instantiate(this.ObjectNodeArray[e]);
  }, e.prototype.Recovey = function (e, t) {
    e.active = !1, e.stopAllActions(), this.ObjectPollArray[t].put(e);
  }, t = oo([i], e);
}());
o["default"] = r;

cc._RF.pop();